<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
     <button id="btn_1">打开窗口</button>
	 <button id="btn_2">关闭窗口</button>
 </body>
  <script>
    var $ = function(obj){
	   return document.getElementById(obj);
	}
	window.onload = function(){
	   var btn_1 = $("btn_1");
       var btn_2 = $("btn_2");
	   //打开窗口
	   var close;
	   btn_1.onclick = function(){
	     close = window.open("http://www.zhiliaotang.com","_blank","toolbar=yes,location=yes,directories=no,width=500,height=500,resizeable=no");
	   }
	   //关闭窗口
	   btn_2.onclick = function(){
	     close.close();
	   }
	}
  </script>
</html>
